<?php

/*
 * Created on 2011-4-13
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
require ('../Common.inc.php');
require(SERVER_ROOT_PATH.'/config/base.config.php');
require (SERVER_ROOT_PATH . '/lib/Framework.class.php');

new Framework();

$username = $_POST['username'];
$pwd = $_POST['password'];

$u=new User('r');
$res=$u->checkUsernameAndPwd($username,$pwd);


if(count($res)!=1){
	if($u->checkUserExist($username)){
		$_SESSION['errorpwd']=true;
	}else{
		$_SESSION['errorlogin']=$username;
	}
	$u->closeDB();
	header("Location:http://www.xiabandu.com/login.php");
}else{
	$_SESSION['errorlogin']='';
	$_SESSION['errorpwd']='';
	$_SESSION['username']=$username;
	$u->closeDB();
	header("Location:http://www.xiabandu.com/user/showlist.php");
}


?>
